package com.bjsxt.chapter19_observer.observer2;

/**
 * @ClassName Client
 * @Description 客户端
 * @Author 黑马程序员
 * @Date 15:41 2024/6/25
 * @Version 1.0
 **/
public class Client {
    public static void main(String[] args) {
        ConcreteSubject subject = new ConcreteSubject();

        ObserverA obj1 = new ObserverA();
        ObserverA obj2 = new ObserverA();
        ObserverA obj3 = new ObserverA();

        subject.addObserver(obj1);
        subject.addObserver(obj2);
        subject.addObserver(obj3);

        subject.setState(3000);
        System.out.println("**********目标对象的值发生了变化**********");
        System.out.println(obj1.getMyState());
        System.out.println(obj2.getMyState());
        System.out.println(obj3.getMyState());

    }
}
